<template>
    <div class="indexbannar">
        <img src="../../static/image/shouyi/shouyi.gif" style="width: 100%">
        <img src="../../static/image/shouyi/youhui.gif" style="width: 100%">
        <div id="content">
            <div v-for="(item, key) in Lists" :key="key">
                <yd-flexbox v-show="item.type=='1'" class="content_list">
                    <yd-flexbox-item>
                        <yd-flexbox-item><p class="content_left_p1">{{item.title}}</p></yd-flexbox-item>
                        <yd-flexbox-item><p class="content_left_p">{{item.user_name}}</p></yd-flexbox-item>
                        <yd-flexbox-item><p class="content_left_p">{{item.num}}吨</p></yd-flexbox-item>
                    </yd-flexbox-item>
                    <yd-flexbox-item>
                        <yd-flexbox-item><p class="content_right_p1">省￥:{{item.money}}元</p></yd-flexbox-item>
                        <yd-flexbox-item><img src="../../static/image/shouyi/shopping.png" class="content_right_p2" @click="joinvip(item.type,item.type)"></yd-flexbox-item>
                    </yd-flexbox-item>
                </yd-flexbox>
                <yd-flexbox v-show="item.type=='0'" class="content_list">
                    <yd-flexbox-item>
                        <yd-flexbox-item><p class="content_left_p1">{{item.user_name}}</p></yd-flexbox-item>
                        <yd-flexbox-item><p class="content_left_p">{{item.title}}</p></yd-flexbox-item>
                        <yd-flexbox-item><p class="content_left_p"><img src="../../static/image/shouyi/zhuan.png" style="position: relative;top: 0.05rem">&nbsp;&nbsp;{{item.money}}元</p></yd-flexbox-item>
                    </yd-flexbox-item>
                    <yd-flexbox-item>
                        <yd-flexbox-item><p class="content_right_p1">得:&nbsp;<span>{{item.money}}元</span></p></yd-flexbox-item>
                        <yd-flexbox-item><img src="../../static/image/shouyi/jiaruhuiyuan.png" class="content_right_p2" @click="joinvip(item.type,item.type)"></yd-flexbox-item>
                    </yd-flexbox-item>
                </yd-flexbox>
            </div>
        </div>
    </div>
</template>
<style type="text/css">
    #content{
        padding: 0.2rem;
    }
    .content_list{
        margin-bottom: 0.2rem;
        background-color: rgb(255, 255, 255);
        padding: 0.2rem 0 0.2rem 0;
    }
    .content_left_p1{
        font-size: 0.33rem;
        color: #2d2c2c;
    }
    .content_left_p{
        color: #e5e5e5;
        margin-top: 0.07rem;
        font-size: 0.27rem;
    }
    .content_right_p1{
        margin-left: 0.65rem;
        color: #ff4949;
        font-weight: bold;
    }
    .content_right_p2{
        margin:0.2rem 0 0 0.7rem;
    }
</style>
<script type="text/babel">
    export default {
        data () {
            return {
                Lists: []
            }
        },
        mounted () {
            this.getProfitList()
        },
        methods: {
            // 获取收益列表
            getProfitList () {
                this.$api.getprofit({ }, res => {
                    this.Lists = res.data
                })
            },
            joinvip (type, val) {
                this.$router.push({path: '/vip'})
            }
        }
    }
</script>
